<?php 
   class Custom_Action_Helper_Reflector extends Zend_Controller_Action_Helper_Abstract {
       /**
        * @var Zend_Loader_PluginLoader
        */
       public $pluginLoader;

       /**
        * Constructor: initialize plugin loader
        *
        * @return void
        */
       public function __construct() {
          
       }

       /**
        * Strategy pattern: call helper as broker method
        */
   
       
       public function getList($module)
       {
          
//         $module_dir = substr(str_replace("\\", "/", $this->getFrontController()->getModuleDirectory()), 0, strrpos(str_replace("\\", "/", $this->getFrontController()->getModuleDirectory()), '/'));
//        $temp = array_diff(scandir($module_dir), Array(".", "..", ".svn"));
//        
//        $modules = array();
        $controller_directorys = array();
    
        array_push($controller_directorys, str_replace("\\", "/", $this->getFrontController()->getControllerDirectory($module)));
        foreach ($controller_directorys as $dir) {
            foreach (scandir($dir) as $dirstructure) {
                if (is_file($dir . "/" . $dirstructure)) {
                    if (strstr($dirstructure, "Controller.php") != false) {
                        include_once($dir . "/" . $dirstructure);
                    }
                }
            }
        }

        $default_module = $this->getFrontController()->getDefaultModule();

        $db_structure = array();

        foreach (get_declared_classes() as $c) {
            if (is_subclass_of($c, 'Zend_Controller_Action')) {
                $functions = array();
                foreach (get_class_methods($c) as $f) {
                    if (strstr($f, "Action") != false) {
                        array_push($functions, substr($f, 0, strpos($f, "Action")));
                    }
                }
                $c = strtolower(substr($c, 0, strpos($c, "Controller")));

                if (strstr($c, "_") != false) {
                    $db_structure[substr($c, 0, strpos($c, "_"))][substr($c, strpos($c, "_") + 1)] = $functions;
                } else {
                    $db_structure[$default_module][$c] = $functions;
                }
            }
        }        
            //unset($db_structure['custom']);
            return $db_structure;
       }
     
}
    
    
 ?>   